﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.Serialization;
using System.ServiceModel;

namespace DynamicDNS.Model
{
    [DataContract]
    public class Configuration
    {
        [DataMember]
        public List<Record> Records { get; set; }
        [DataMember]
        public StartType StartType { get; set; }
        public void Update(Record record)
        {
            var original = Records.Find(d => d.Domain == record.Domain && d.Host == record.Host);
            if (original != null)
                original = record;
            else
                Records.Add(record);
        }
    }
}
